<template>
	<view class="notice-page full box relative bg-primary flex-col">
		<view class="w-wrap">
			<view class="w-inner">
				<mescroll-uni @init="mescrollInit" :fixed="false" @down="downCallback" @up="upCallback">
					<view class="record-list">
						<view class="record-item" v-for="(item,index) in list" :key="index">
							<view class="item-title">
								<text>{{ item.title }}</text>
							</view>
							<view class="item-content">
								<text>{{ item.zi_title }}</text>
							</view>
						</view>
					</view>
				</mescroll-uni>
			</view>
		</view>
	</view>
</template>

<script>
	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	import { request } from '@/utils/tool';
	export default {
		mixins: [MescrollMixin],
		data() {
			return {
				list: []
			}
		},
		methods: {
			async upCallback(ev) {
				const { num, size } = ev
				const resp = await request({
					url: "/gonggao/lists",
					method: "GET",
					data: {
						page_no: num,
						page_size: size
					}
				})
				const { lists, count } = resp.data
				if (num === 1) this.list = []
				this.list.push(...lists)
				this.mescroll.endBySize(lists.length, count)
			}
		},
	}
</script>

<style lang="scss" scoped>
	.record-list {
		padding: 24rpx 30rpx 0;
		box-sizing: border-box;
		position: relative;

		.record-item {
			padding: 28rpx 30rpx;
			background-color: #fff;
			background: #FFFFFF;
			border-radius: 10rpx 10rpx 10rpx 10rpx;
			margin-bottom: 16rpx;

			&:last-child {
				margin-bottom: 0;
			}

			.item-title {
				font-weight: bold;
				font-size: 30rpx;
				color: #333333;
				line-height: 44rpx;
			}

			.item-content {
				font-size: 26rpx;
				color: #333333;
				line-height: 40rpx;
				margin-top: 12rpx;
			}
		}
	}
</style>